package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

//注意直接在IDE启动是无法访问assets下的资源的，需要通过命令行直接执行go build -o router_static.exe && router_static.exe
func main() {
	r := gin.Default()
	r.Static("/assets", "./assets")
	r.StaticFS("/static", http.Dir("static"))
	r.StaticFile("favicon.ico", "./favicon.ico")
	_ = r.Run()
	//curl -X GET "http://127.0.0.1:8080/assets/a.html?n=s"
}
